package load

import (
	"image"
	"image/png"
	"os"
)

func LoadPhoto(address string) (length int, width int, img image.Image, err error) {
	file, err := os.Open(address)
	if err != nil {
		return -1, -1, nil, err
	}
	defer file.Close()

	img, err = png.Decode(file)
	if err != nil {
		return -1, -1, nil, err
	}

	length = img.Bounds().Dx()
	width = img.Bounds().Dy()
	return
}